feat: GUI からのシェルコマンド実行の追加 (#17)#21
Merged
Merged
Conversation
- Add executeShell() method to opencode-client.ts - Add executeShell message type to webview protocol - Add handler in chat-view-provider.ts - Detect ! prefix in InputArea and route to onShellExecute - Add shell mode indicator and placeholder - Add locale keys for shell mode (en/ja)
- Create ShellResultView with $ prompt, output display, spinner - Support completed/running/pending/error states - Wire onShellExecute and isShellMessage through AppContext - Connect handleShellExecute in App.tsx
- Track both user and assistant messages as shell in useMessages - Hide user bubble for shell commands (ShellResultView shows $ command) - Render ShellResultView instead of ToolPartView for shell assistant messages - Filter out synthetic TextParts for shell messages
- Add className='markdown' to TextPartView span element - Change .content pre/code/ul/ol/li/p selectors to .content :global(.markdown) variants - Prevents Markdown styles from leaking into ShellResultView and other child components
- Add ShellResultView unit tests (14 tests): states, toggle, multiple entries, edge cases - Add useMessages shell tracking tests (5 tests): markPendingShell, isShellMessage, flag lifecycle - Add MessageItem shell tests (3 tests): ShellResultView rendering, text hiding, user bubble hiding - Add scenario tests (16 tests): input, mode indicator, result display, error, running state - Update MessageItem/MessagesArea tests with AppContextProvider wrapper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
チャット入力欄で
!プレフィクスを付けてシェルコマンドを実行できる機能を追加。結果はターミナル風の専用 UI(ShellResultView)で表示される。
Closes #17
変更内容
シェルコマンド実行の基盤
opencode-client.tsにexecuteShell()メソッドを追加executeShellメッセージタイプを追加chat-view-provider.tsにハンドラーを追加InputAreaで!プレフィクスを検出し、シェルモードインジケーター・専用プレースホルダーを表示input.shellMode,input.placeholder.shell,shell.title)ShellResultView コンポーネント
$ commandプロンプト + 出力をターミナル風に一体表示する新コンポーネントユーザー吹き出しの非表示
useMessagesで user / assistant 両メッセージをシェルとしてタグ付け$ commandで代替)CSS スコープ修正
.content :global(.markdown)に限定TextPartViewにclassName="markdown"を追加テスト(49ファイル / 653テスト)
markPendingShell,isShellMessage, フラグライフサイクルチェックリスト
npm run buildpassesnpm testpasses